<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
class SCTV_MaintenanceGroupCommon extends ModuleCommon {
    public static function menu() {
		return array(__('SCTV') => array(
    		'__submenu__' => 1, __('BẢO TRÌ') => array(
    			'__submenu__' => 2,  __('List') => array(
    			'__submenu__' => 3,
        		__('Maintenance Group') => array(),
			))
		));
    }
	
	public static function get_maintenance_group()
    {
        $group = DB::GetAssoc('
			SELECT id, f_name
			FROM sctv_maintenancegroup_data_1
			where active = 1
		');
        
        foreach ($group as $k=>$u){
            $group[$k] = $u;
		}
        asort($group);
        $group = array(''=>__('All'))+$group;
        return $group;
    }
	
	public static function get_name($groupid)
    {
        $group = DB::GetOne('
			SELECT f_name
			FROM sctv_maintenancegroup_data_1
			where active = 1 and id = %d
			',
            array($groupid)
		);
        
        return $group;
    }
}

?>